package com.woniuxy.springboot08rabbitmq.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkCustomer {
    @RabbitListener(queuesToDeclare = @Queue("queue2"))
    public void receiveMSG1(String msg) {
        System.out.println("消费者1:" + msg);
    }

    @RabbitListener(queuesToDeclare = @Queue("queue2"))
    public void receiveMSG2(String msg) {
        System.out.println("消费者2:" + msg);
    }
}
